package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * SdCustDiscount generated by hbm2java
 */
@Entity
@Table(name="sd_cust_discount"
    ,catalog="ncsc_erp"
)
public class SdCustDiscount  implements java.io.Serializable {


     private SdCustDiscountId id;
     private SdCust sdCust;
     private BigDecimal custDiscountPerc;
     private Date custDiscountEffectiveDate;
     private Date custDiscountExpireDate;
     private Short custDiscountIsActive;

    public SdCustDiscount() {
    }

	
    public SdCustDiscount(SdCustDiscountId id, SdCust sdCust) {
        this.id = id;
        this.sdCust = sdCust;
    }
    public SdCustDiscount(SdCustDiscountId id, SdCust sdCust, BigDecimal custDiscountPerc, Date custDiscountEffectiveDate, Date custDiscountExpireDate, Short custDiscountIsActive) {
       this.id = id;
       this.sdCust = sdCust;
       this.custDiscountPerc = custDiscountPerc;
       this.custDiscountEffectiveDate = custDiscountEffectiveDate;
       this.custDiscountExpireDate = custDiscountExpireDate;
       this.custDiscountIsActive = custDiscountIsActive;
    }
   
     @EmbeddedId

    
    @AttributeOverrides( {
        @AttributeOverride(name="custNo", column=@Column(name="CUST_NO", nullable=false) ), 
        @AttributeOverride(name="custDiscountSeqNo", column=@Column(name="CUST_DISCOUNT_SEQ_NO", nullable=false) ) } )
    public SdCustDiscountId getId() {
        return this.id;
    }
    
    public void setId(SdCustDiscountId id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="CUST_NO", nullable=false, insertable=false, updatable=false)
    public SdCust getSdCust() {
        return this.sdCust;
    }
    
    public void setSdCust(SdCust sdCust) {
        this.sdCust = sdCust;
    }

    
    @Column(name="CUST_DISCOUNT_PERC", precision=10)
    public BigDecimal getCustDiscountPerc() {
        return this.custDiscountPerc;
    }
    
    public void setCustDiscountPerc(BigDecimal custDiscountPerc) {
        this.custDiscountPerc = custDiscountPerc;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="CUST_DISCOUNT_EFFECTIVE_DATE", length=10)
    public Date getCustDiscountEffectiveDate() {
        return this.custDiscountEffectiveDate;
    }
    
    public void setCustDiscountEffectiveDate(Date custDiscountEffectiveDate) {
        this.custDiscountEffectiveDate = custDiscountEffectiveDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="CUST_DISCOUNT_EXPIRE_DATE", length=10)
    public Date getCustDiscountExpireDate() {
        return this.custDiscountExpireDate;
    }
    
    public void setCustDiscountExpireDate(Date custDiscountExpireDate) {
        this.custDiscountExpireDate = custDiscountExpireDate;
    }

    
    @Column(name="CUST_DISCOUNT_IS_ACTIVE")
    public Short getCustDiscountIsActive() {
        return this.custDiscountIsActive;
    }
    
    public void setCustDiscountIsActive(Short custDiscountIsActive) {
        this.custDiscountIsActive = custDiscountIsActive;
    }




}


